package lab01;

import java.util.Scanner;
public class Test08 {
    public static void main(String[] args) {
        int count=1;
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个整数：");
        double d=Math.random();
        int number=(int)(d*100)+1;
        for(int i=0;i<=100;i++){

            int x=sc.nextInt();
            if(x<number){
                System.out.println("猜小了！");
            }else if(x>number){
                System.out.println("猜大了！");
            }else if(x==number){
                System.out.println("猜对了！");
                break;
            }
            count++;
        }
        if (count<=7) {

            System.out.println("你共猜了"+count+"次就猜对了，你真是天才！！！");
        }else {
            System.out.println("你共猜了"+count+"次就猜对了，小傻瓜！！！");
        }
    }
}
